package com.fanbai.score.staff.fragemnt;

/**
 * Created by acer on 2017/5/6.
 */

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.fanbai.score.R;
import com.fanbai.score.common.base.BaseFragment;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * A placeholder fragment containing a simple view.
 */
public class Integral_Fragment extends BaseFragment {
    @BindView(R.id.view_recyclerView)
    RecyclerView mRecyclerView;

    /**
     * The fragment argument representing the section number for this
     * fragment.
     */
    private static final String ARG_SECTION_NUMBER = "section_number";

    /**
     * Returns a new instance of this fragment for the given section
     * number.
     */
    public static Integral_Fragment newInstance(int sectionNumber) {
        Integral_Fragment fragment = new Integral_Fragment();
        Bundle args = new Bundle();
        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;
    }

    public Integral_Fragment() {
    }


    @Override
    protected int getLayoutID() {
        return R.layout.staff_fragment_intefral;
    }

    @Override
    public String getTitleName() {
        return "积分";
    }

    @Override
    public void iniTitleLeft(ImageView imageView) {
    }

    @Override
    public void iniTitleRight(TextView tv) {
        tv.setText("添加");
    }

    @Override
    protected void initView(View view) {
    }

    @Override
    protected void initData() {
        List<String> dataList = new ArrayList<>();
        dataList.add("qwer");
        dataList.add("jpg");
        dataList.add("48.jpg");
        mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
        mRecyclerView.setAdapter(new CommonAdapter<String>(ctx, R.layout.staff_item_integralfragment,
                dataList){
            @Override
            protected void convert(ViewHolder holder, String s, int position) {
                holder.setText(R.id.staffItemIntegralFragment_remarks, ""+s);
            }
        });
    }

    @Override
    protected void initListener() {

    }
}
